home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-079.TXT < prev    next >
Encoding:
Text File  |  1992-06-04  |  42.4 KB  |  1,224 lines

  1. C.S.M.P. Digest             Wed, 13 May 92       Volume 1 : Issue 79
  2.  
  3. Today's Topics:
  4.  
  5.     MPW QUESTIONS
  6.     "Use Custom Icon" Finder flag - info?
  7.     How to tell if a window has a title bar?
  8.     Checking if modem or printer port is already in use
  9.     Does MPW support aliases?
  10.     Animating floating point numbers?
  11.     Discipline, Mbg 6.2.2, Quadra
  12.     THINK C PROGRAM QUESTION
  13.     Simple Sound Program
  14.     UPMG II
  15.     Centering window from an INIT; how?
  16.  
  17.  
  18. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  19.  
  20. These digests are available (by using FTP, account anonymous, your email
  21. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  22. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  23. Questions list.  The last several issues of the digest are available from
  24. sumex-aim.stanford.edu as well.
  25.  
  26. These digests are also available via email.  Just send a note saying that you
  27. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  28. automatically receive each new digest as it is created.
  29.  
  30. The digest is a collection of articles from the internet newsgroup comp.sys.
  31. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  32. and want an archive of the discussions.  If you don't know what a newsgroup
  33. is, you probably don't have access to it.  Ask your systems administrator(s)
  34. for details.  (This means you can't post questions to the digest.)
  35.  
  36. The articles in these digests are taken directly from comp.sys.mac.programmer.
  37. They are not edited; all articles included in this digest are in their original
  38. posted form.  The only articles that are -not- included in these digests are
  39. those which didn't receive any replies (except those that give information
  40. rather than ask a question).  All replies to each article are concatenated
  41. onto the original article in the order in which they were received.  Article
  42. threads are not added to the digests until the last article added to the
  43. thread is at least one month old (this is to ensure that the thread is dead
  44. before adding it to the digests).
  45.  
  46. Send administrative mail to mkelly@cs.uoregon.edu.
  47.  
  48. -------------------------------------------------------
  49.  
  50. From: chrism@col.hp.com (Chris Magnuson)
  51. Subject: MPW QUESTIONS
  52. Date: 12 Apr 92 20:57:52 GMT
  53. Organization: HP Colorado Springs Division
  54.  
  55. Two questions:
  56.  
  57.   1. Does anyone have experience with the Incremental Build System utility from
  58.      Jasik?  I want to know how much it costs, where to get it, and whether it
  59.      makes links any faster (how much?).
  60.  
  61.   2. Is it true that Think Pascal is much faster than MPW Pascal?
  62.  
  63. Thanks,
  64. Chris Magnuson
  65. chrism@col.hp.com
  66.  
  67. +++++++++++++++++++++++++++
  68.  
  69. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  70. Date: 13 Apr 92 08:00:22 GMT
  71. Organization: Royal Institute of Technology, Stockholm, Sweden
  72.  
  73. > chrism@col.hp.com (Chris Magnuson) writes:
  74.  
  75.      2. Is it true that Think Pascal is much faster than MPW Pascal?
  76.  
  77. Definately.
  78.  
  79. - -- 
  80. "You should meet yourself someday. I'm sure you would hate it."
  81. - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
  82.  
  83. ---------------------------
  84.  
  85. From: bdugan@hal.gnu.ai.mit.edu (Bill Dugan)
  86. Subject: "Use Custom Icon" Finder flag - info?
  87. Date: 12 Apr 92 23:59:37 GMT
  88. Organization: MIT Laboratory for Computer Science
  89.  
  90. I was poking around on my friend's Quadra today and saved a GIF from 
  91. Photoshop 2.0...and the icon created was a miniature version of the GIF itself!!
  92. Wow!!! That's the greatest thing I've ever seen, I said...Poking around,
  93. I found a flag from Resedit called "Use Custom Icon".
  94.  
  95. Is this documented anywhere?  I want my own apps to use this wonderful
  96. system idea....
  97.  
  98. bill
  99.  
  100. - -- 
  101. Bill Dugan
  102. bdugan@gnu.ai.mit.edu
  103.  
  104. +++++++++++++++++++++++++++
  105.  
  106. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  107. Date: 13 Apr 92 08:03:30 GMT
  108. Organization: Royal Institute of Technology, Stockholm, Sweden
  109.  
  110. > bdugan@hal.gnu.ai.mit.edu (Bill Dugan) writes:
  111.  
  112.    Photoshop 2.0...and the icon created was a miniature version of the GIF
  113.    itself!! Wow!!! That's the greatest thing I've ever seen, I said...
  114.    Poking around, I found a flag from Resedit called "Use Custom Icon".
  115.  
  116.    Is this documented anywhere?  I want my own apps to use this wonderful
  117.    system idea....
  118.  
  119. Yes, it's documented in Inside Mac VI. However, it's only
  120. available under the system 7 Finder.
  121.  
  122. - -- 
  123. "You should meet yourself someday. I'm sure you would hate it."
  124. - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
  125.  
  126. ---------------------------
  127.  
  128. From: tnorthtj@cc.curtin.edu.au (Tim North)
  129. Subject: How to tell if a window has a title bar?
  130. Date: 26 Mar 92 02:15:42 GMT
  131. Organization: Curtin University of Technology
  132.  
  133. I'm trying to center my windows on the screen. Sounds simple, and it is.
  134. The problem though, is that I am using the window's portRect to determine
  135. its dimensions, and the portRect doesn't take into account the height of the
  136. title-bar (if there is one).
  137.  
  138. Simple to fix, thinks I, I'll just look at the windowKind field in the
  139. WindowRecord. Nope. This is just 2 if its a dialog or 8 otherwise. (Remember,
  140. modeless dialogs have a title-bar, modal ones don't, so that's no use.)
  141.  
  142. How then do I determine if my window has a title-bar? (Or, just in case I've
  143. lost the woods for the trees, how do I accurately center my windows?)
  144.  
  145. Regards, 
  146. - -------------------------------------------------------------------------------
  147.     _--_|\      | Dept Computer Engineering, Curtin University of Technology
  148.    /      \     | Perth. Western Australia. 6102.    Phone: (+61 9) 351 7908
  149. - -->\_.--._/     | Internet: North_TJ@cc.curtin.edu.au
  150.          v      | Bitnet:   North_TJ%cc.curtin.edu.au@cunyvm.bitnet
  151.   TIM NORTH     | UUCP:     uunet!munnari.oz!cc.curtin.edu.au!North_TJ
  152. - -------------------------------------------------------------------------------
  153.  
  154. +++++++++++++++++++++++++++
  155.  
  156. From: asunta@convex.csc.FI (Miika Asunta)
  157. Date: 26 Mar 92 18:51:08 GMT
  158. Organization: Finnish Academic and Research Network Project - FUNET
  159.  
  160. In <1992Mar26.111542.1@cc.curtin.edu.au> tnorthtj@cc.curtin.edu.au (Tim North) writes:
  161.  
  162. >I'm trying to center my windows on the screen. Sounds simple, and it is.
  163. >The problem though, is that I am using the window's portRect to determine
  164. >its dimensions, and the portRect doesn't take into account the height of the
  165. >title-bar (if there is one).
  166.  
  167. >Simple to fix, thinks I, I'll just look at the windowKind field in the
  168. >WindowRecord. Nope. This is just 2 if its a dialog or 8 otherwise. (Remember,
  169. >modeless dialogs have a title-bar, modal ones don't, so that's no use.)
  170.  
  171. >How then do I determine if my window has a title-bar? (Or, just in case I've
  172. >lost the woods for the trees, how do I accurately center my windows?)
  173.  
  174. You should use rgnBBox Rect of structRgn from WindowRecord instead
  175. of portRect.
  176.  
  177. In C you can assign it directly...
  178.  
  179. void foo()
  180. {
  181. WindowPeek wp;
  182. Rect windowboundsrect;
  183.  
  184. windowboundsrect=(**(wp->structRgn)).rgnBBox;
  185. }
  186.  
  187. Hope this helps,
  188.  
  189. Miika
  190. - --
  191. &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  192. &  Miika Asunta        &  asunta@convex.csc.fi  &  Double Bass Player   &
  193. & tel. +358-0-494 093  &             &  Macintosh Programmer &
  194. &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  195.  
  196. +++++++++++++++++++++++++++
  197.  
  198. From: Michael_Hecht@mac.sas.com (Michael Hecht)
  199. Organization: SAS Institute Inc.
  200. Date: Thu, 26 Mar 1992 20:03:05 GMT
  201.  
  202. In article <1992Mar26.111542.1@cc.curtin.edu.au>,
  203.    tnorthtj@cc.curtin.edu.au (Tim North) writes:
  204. > How then do I determine if my window has a title-bar?
  205.  
  206. Here's how I compute the height of a window's title bar:
  207.  
  208.     /* Convert window's portRect to global coordinates */
  209.     windRect = theWindow->portRect;
  210.     LocalToGlobal( &topLeft( windRect ));
  211.     LocalToGlobal( &botRight( windRect ));
  212.  
  213.     /* Calculate the height of the window's title bar */
  214.     bias = windRect.top - 1 - ( *(( WindowPeek )theWindow )->strucRgn )->rgnBBox.top;
  215.     windRect.top -= bias;
  216.  
  217. > (Or, just in case I've lost the woods for the trees, how do I accurately
  218. > center my windows?)
  219.  
  220. Here's what I do:
  221.  
  222. /* CenterRect:    Center a rectangle on the main screen */
  223. static void CenterRect( Rect *r )
  224. {
  225.     short                delta, screenTop;
  226.  
  227.  
  228.     /* Center it horizontally */
  229.     delta = r->right - r->left;
  230.     r->left  = ( screenBits.bounds.right - delta ) >> 1;
  231.     r->right = r->left + delta;
  232.  
  233.     /* Determine top of screen */
  234.     screenTop = GetMBarHeight();
  235.  
  236.     /* Place it in upper third of screen */
  237.     delta = r->bottom - r->top;
  238.     r->top = ( screenBits.bounds.bottom - screenTop - delta ) / 3 + screenTop;
  239.     r->bottom = r->top + delta;
  240. }
  241.  
  242. void CenterDialog( short id, Point *corner )
  243. {
  244.     DialogTHndl            theDLOG;
  245.     Rect                bounds;
  246.  
  247.  
  248.     /* Get the DLOG resource */
  249.     theDLOG = ( DialogTHndl )GetResource( 'DLOG', id );
  250.     if( !theDLOG )
  251.         return;
  252.  
  253.     /* Center it within screenBits */
  254.     bounds = ( *theDLOG )->boundsRect;
  255.     CenterRect( &bounds );
  256.     ( *theDLOG )->boundsRect = bounds;
  257.  
  258.     if( corner )
  259.         *corner = topLeft( bounds );
  260. }
  261.  
  262. static void CenterAlert( short id )
  263. {
  264.     AlertTHndl            theALRT;
  265.     Rect                bounds;
  266.  
  267.  
  268.     /* Get the ALRT resource */
  269.     theALRT = ( AlertTHndl )GetResource( 'ALRT', id );
  270.     if( !theALRT )
  271.         return;
  272.  
  273.     /* Center it within screenBits */
  274.     bounds = ( *theALRT )->boundsRect;
  275.     CenterRect( &bounds );
  276.     ( *theALRT )->boundsRect = bounds;
  277. }
  278.  
  279. short DoAlert( short kind, short alertID, ProcPtr filterProc )
  280. {
  281.     short                item;
  282.  
  283.  
  284.     CenterAlert( alertID );
  285.     SetCursor( &arrow );
  286.     switch( kind ) {
  287.  
  288.     case stopIcon:
  289.         item = StopAlert( alertID, filterProc );
  290.         break;
  291.  
  292.     case noteIcon:
  293.         item = NoteAlert( alertID, filterProc );
  294.         break;
  295.  
  296.     case cautionIcon:
  297.         item = CautionAlert( alertID, filterProc );
  298.         break;
  299.  
  300.     default:
  301.         item = Alert( alertID, filterProc );
  302.         break;
  303.     }
  304.  
  305.     return item;
  306. }
  307.  
  308.  
  309. For dialogs, I call CenterDialog. It will optionally hand me back the top,left
  310. coordinate (handy for calls to SFGetFile, etc.). For alerts, I just call
  311. DoAlert, which will center it for me. Note that it adjusts for the menu bar
  312. but not for the title bar. This is because my method is used BEFORE calling
  313. GetNewDialog, as it tweaks the in-memory copy of the DLOG resource. There's
  314. no structure region to peek at at that time. If you're centering the window
  315. after its created, you could use the bounding box of the window's structure
  316. region, rather than its portRect. That would take care of the title bar as
  317. well as anything else.
  318.  
  319. Have fun!
  320.  
  321. - --Michael
  322.  
  323. =======================================================================
  324. Michael P. Hecht                 | Internet:  Michael_Hecht@mac.sas.com
  325. SAS Institute Inc.; Cary, NC USA | AppleLink: SAS.HECHT
  326.  
  327. +++++++++++++++++++++++++++
  328.  
  329. From: Joe.Francis@dartmouth.edu (Joe Francis)
  330. Date: 26 Mar 92 21:25:38 GMT
  331. Organization: Dartmouth College, Hanover, NH
  332.  
  333. In article <1992Mar26.185108.14007@nic.funet.fi>
  334. asunta@convex.csc.FI (Miika Asunta) writes:
  335.  
  336. >>How then do I determine if my window has a title-bar? (Or, just in case I've
  337. >>lost the woods for the trees, how do I accurately center my windows?)
  338. [Tim North]
  339.  
  340. > You should use rgnBBox Rect of structRgn from WindowRecord instead
  341. > of portRect.    [Miika Asunta]
  342.  
  343. No.  This value will be invalid if the window has not been drawn on the
  344. screen.  Since one of the primary uses of centering windows is to
  345. create the window invisible, center it, and then show it, structRgn is
  346. not a general solution to this problem.
  347.  
  348. I even tried sending the WDEF a calc regions message to try to fool it
  349. into validating structRgn, but (under system 7, at least) this will
  350. result in confusing the window manager beyond help.
  351.  
  352. I don't have a good general solution to this problem.  I end up looking
  353. at the window variant and assuming it's a standard window variant (as
  354. opposed to a custom WDEF that might have a different structure region
  355. from the standard WDEF).  If anyone can improve on this, please clue
  356. the rest of us in!
  357.  
  358. +++++++++++++++++++++++++++
  359.  
  360. From: f85-tno@nada.kth.se (Tommy Nordgren)
  361. Date: 6 Apr 92 15:14:47 GMT
  362. Organization: Royal Institute of Technology, Stockholm, Sweden
  363.  
  364. In article <1992Mar26.212538.4018@dartvax.dartmouth.edu>, Joe.Francis@dartmouth.edu (Joe Francis) writes:
  365. |> In article <1992Mar26.185108.14007@nic.funet.fi>
  366. |> asunta@convex.csc.FI (Miika Asunta) writes:
  367. |> 
  368. |> >>How then do I determine if my window has a title-bar? (Or, just in case I've
  369. |> >>lost the woods for the trees, how do I accurately center my windows?)
  370. |> [Tim North]
  371. |>  
  372. |> > You should use rgnBBox Rect of structRgn from WindowRecord instead
  373. |> > of portRect.    [Miika Asunta]
  374. |> 
  375. |> No.  This value will be invalid if the window has not been drawn on the
  376. |> screen.  Since one of the primary uses of centering windows is to
  377. |> create the window invisible, center it, and then show it, structRgn is
  378. |> not a general solution to this problem.
  379. |> 
  380. |> I even tried sending the WDEF a calc regions message to try to fool it
  381. |> into validating structRgn, but (under system 7, at least) this will
  382. |> result in confusing the window manager beyond help.
  383. |> 
  384. |> I don't have a good general solution to this problem.  I end up looking
  385. |> at the window variant and assuming it's a standard window variant (as
  386. |> opposed to a custom WDEF that might have a different structure region
  387. |> from the standard WDEF).  If anyone can improve on this, please clue
  388. |> the rest of us in!
  389. Beside checking the variant code, also get Resource info for the window
  390. definition procedure. If the ID is 1 then it is a standard window.
  391.  
  392. +++++++++++++++++++++++++++
  393.  
  394. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  395. Organization: Royal Institute of Technology, Stockholm, Sweden
  396. Date: Mon, 6 Apr 1992 21:13:42 GMT
  397.  
  398. .se> f85-tno@nada.kth.se (Tommy Nordgren) writes:
  399.  
  400.    |> > You should use rgnBBox Rect of structRgn from WindowRecord instead
  401.    |> > of portRect.    [Miika Asunta]
  402.    |> 
  403.    |> No.  This value will be invalid if the window has not been drawn on the
  404.    |> screen.  Since one of the primary uses of centering windows is to
  405.    |> create the window invisible, center it, and then show it, structRgn is
  406.    |> not a general solution to this problem.
  407.  
  408.    Beside checking the variant code, also get Resource info for the window
  409.    definition procedure. If the ID is 1 then it is a standard window.
  410.  
  411.  
  412. However, there are lots of INITs that patch the standard window defProc
  413. so that won't work.
  414.  
  415. What you do is as many others have said:
  416.  
  417.     1) MoveWindow ( theWindow , 25000 , 25000 , FALSE ) ;
  418.     2) ShowWindow ( theWindow ) ;
  419.     3) SelectWindow ( theWindow ) ;
  420.     4) NOW you can check the structure region for the "true"
  421.        size of the window.
  422.     5) MoveWindow ( theWindow , whatever you center with ) ;
  423.  
  424. This will, in effect, make the window appear as if you ShowWindowed
  425. it after it was centered.
  426.  
  427. - -- 
  428. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  429.  
  430. +++++++++++++++++++++++++++
  431.  
  432. From: f85-tno@nada.kth.se (Tommy Nordgren)
  433. Date: 6 Apr 92 15:14:47 GMT
  434. Organization: Royal Institute of Technology, Stockholm, Sweden
  435.  
  436. In article <1992Mar26.212538.4018@dartvax.dartmouth.edu>, Joe.Francis@dartmouth.edu (Joe Francis) writes:
  437. |> In article <1992Mar26.185108.14007@nic.funet.fi>
  438. |> asunta@convex.csc.FI (Miika Asunta) writes:
  439. |> 
  440. |> >>How then do I determine if my window has a title-bar? (Or, just in case I've
  441. |> >>lost the woods for the trees, how do I accurately center my windows?)
  442. |> [Tim North]
  443. |>  
  444. |> > You should use rgnBBox Rect of structRgn from WindowRecord instead
  445. |> > of portRect.    [Miika Asunta]
  446. |> 
  447. |> No.  This value will be invalid if the window has not been drawn on the
  448. |> screen.  Since one of the primary uses of centering windows is to
  449. |> create the window invisible, center it, and then show it, structRgn is
  450. |> not a general solution to this problem.
  451. |> 
  452. |> I even tried sending the WDEF a calc regions message to try to fool it
  453. |> into validating structRgn, but (under system 7, at least) this will
  454. |> result in confusing the window manager beyond help.
  455. |> 
  456. |> I don't have a good general solution to this problem.  I end up looking
  457. |> at the window variant and assuming it's a standard window variant (as
  458. |> opposed to a custom WDEF that might have a different structure region
  459. |> from the standard WDEF).  If anyone can improve on this, please clue
  460. |> the rest of us in!
  461. Beside checking the variant code, also get Resource info for the window
  462. definition procedure. If the ID is 1 then it is a standard window.
  463.  
  464. +++++++++++++++++++++++++++
  465.  
  466. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  467. Organization: Royal Institute of Technology, Stockholm, Sweden
  468. Date: Mon, 6 Apr 1992 21:13:42 GMT
  469.  
  470. .se> f85-tno@nada.kth.se (Tommy Nordgren) writes:
  471.  
  472.    |> > You should use rgnBBox Rect of structRgn from WindowRecord instead
  473.    |> > of portRect.    [Miika Asunta]
  474.    |> 
  475.    |> No.  This value will be invalid if the window has not been drawn on the
  476.    |> screen.  Since one of the primary uses of centering windows is to
  477.    |> create the window invisible, center it, and then show it, structRgn is
  478.    |> not a general solution to this problem.
  479.  
  480.    Beside checking the variant code, also get Resource info for the window
  481.    definition procedure. If the ID is 1 then it is a standard window.
  482.  
  483.  
  484. However, there are lots of INITs that patch the standard window defProc
  485. so that won't work.
  486.  
  487. What you do is as many others have said:
  488.  
  489.     1) MoveWindow ( theWindow , 25000 , 25000 , FALSE ) ;
  490.     2) ShowWindow ( theWindow ) ;
  491.     3) SelectWindow ( theWindow ) ;
  492.     4) NOW you can check the structure region for the "true"
  493.        size of the window.
  494.     5) MoveWindow ( theWindow , whatever you center with ) ;
  495.  
  496. This will, in effect, make the window appear as if you ShowWindowed
  497. it after it was centered.
  498.  
  499. - -- 
  500. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  501.  
  502. +++++++++++++++++++++++++++
  503.  
  504. From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
  505. Date: Fri, 10 Apr 1992 23:10:03 -0500
  506.  
  507.  TN> From: f85-tno@nada.kth.se (Tommy Nordgren)
  508.  
  509.  TN> In article <1992Mar26.212538.4018@dartvax.dartmouth.edu>,
  510.  TN> Joe.Francis@dartmouth.edu (Joe Francis) writes:
  511.  TN> |> In article <1992Mar26.185108.14007@nic.funet.fi>
  512.  TN> |> asunta@convex.csc.FI (Miika Asunta) writes:
  513.  
  514.  TN> |> I even tried sending the WDEF a calc regions message to try to fool it
  515.  TN> |> into validating structRgn, but (under system 7, at least) this will
  516.  TN> |> result in confusing the window manager beyond help.
  517.  
  518. If you want the strucRgn of an invisible window,
  519. go ahead and send the message to the WDEF and then make sure you
  520. SetEmptyRgn against the strucRgn and contRgn. That's the step you're
  521. missing. I believe there is code on the developer's CDs to do this.
  522. Anyway, I've seen it published before. I've certainly done it before.
  523.  
  524.  TN> Beside checking the variant code, also get Resource info for the window
  525.  TN> definition procedure. If the ID is 1 then it is a standard window.
  526.  
  527. The resource ID you want is 0, not 1. 1 is the round-corner black-title
  528. WDEF used in many DAs.
  529.  
  530. ---------------------------
  531.  
  532. From: slang@bnr.ca (Steven Langlois)
  533. Subject: Checking if modem or printer port is already in use
  534. Organization: Bell-Northern Research Ltd.
  535. Date: Tue, 31 Mar 92 14:16:20 GMT
  536.  
  537. Inside Mac IV states on page 225 that "The new Serial Driver verifies 
  538. that the serial port is correctly configured and free; if not, the
  539. result code portNotCf or portInUse is returned." I assume that this
  540. is with the old RAMSDOpen call but this is no longer supported, you 
  541. are supposed to use OpenDriver which I now do. In fact, I could not
  542. find any reference to portNotCf of portInUse in the Think Pascal 4
  543. files. When I call OpenDriver on a port already in use, it returns 
  544. a noErr result code. 
  545.  
  546. How can I detect when the modem port or serial port is in use?
  547.  
  548. Any help would be much appreciated.
  549.  
  550. Steven Langlois
  551. ISDN Basic Rate Access
  552. Bell-Northern Research
  553.  
  554. Internet: slang@bnr.ca
  555.  
  556.  
  557. +++++++++++++++++++++++++++
  558.  
  559. From: slang@bnr.ca (Steven Langlois)
  560. Date: 12 Apr 92 14:17:30 GMT
  561. Organization: Bell-Northern Research Ltd.
  562.  
  563. I posted the following a while ago but have received nothing to date. Do
  564. I assume from this that there is no way to tell if a port in in use or
  565. not?
  566.  
  567. Any help is greatly appreciated.
  568.  
  569. Steven Langlois
  570. ISDN Basic Rate Access
  571. Bell-Northern Research
  572.  
  573. Internet: slang@bnr.ca
  574.  
  575. In article <1992Mar31.141620.26603@bmers95.bnr.ca>, slang@bnr.ca (Steven Langlois) writes:
  576. |> Inside Mac IV states on page 225 that "The new Serial Driver verifies 
  577. |> that the serial port is correctly configured and free; if not, the
  578. |> result code portNotCf or portInUse is returned." I assume that this
  579. |> is with the old RAMSDOpen call but this is no longer supported, you 
  580. |> are supposed to use OpenDriver which I now do. In fact, I could not
  581. |> find any reference to portNotCf of portInUse in the Think Pascal 4
  582. |> files. When I call OpenDriver on a port already in use, it returns 
  583. |> a noErr result code. 
  584. |> 
  585. |> How can I detect when the modem port or printer port is in use?
  586. |> 
  587. |> Any help would be much appreciated.
  588. |> 
  589. |> Steven Langlois
  590. |> ISDN Basic Rate Access
  591. |> Bell-Northern Research
  592. |> 
  593. |> Internet: slang@bnr.ca
  594. |> 
  595.  
  596. ---------------------------
  597.  
  598. From: nessett@llnl.gov (Danny M. Nessett)
  599. Subject: Does MPW support aliases?
  600. Date: 1 Apr 92 17:25:58 GMT
  601. Organization: LLNL
  602.  
  603. I am having trouble using a folder alias from within the MPW shell. In
  604. particular, if I use the finder to make an alias of a folder, place that
  605. alias in another folder and then try to reference the alias as a child
  606. folder, MPW doesn't cooperate. For example, consider the following
  607. MPW commands and their output :
  608.  
  609. Directory
  610. 'DirectDrive(2):C-Development:ELROS:'
  611. ls -l
  612. Name                  Type Crtr  Size    Flags        Last-Mod-Date       Creation-Date  
  613. - --------------------  ---- ---- ------ ---------- ------------------- -------------------
  614. any.h                 TEXT MPS      3K lvbspoImad    3/31/92  1:16 PM    3/31/92  1:16 PM
  615. doc                   Fldr Fldr  1776K lvbspoImad    3/31/92  1:17 PM    3/31/92  1:16 PM
  616. driver                Fldr Fldr    27K lvbspoImad     4/1/92  8:30 AM    3/31/92  1:18 PM
  617. make-elros.tar        TEXT ????  5400K lvbspoImad    3/18/92  2:21 PM    3/18/92  2:11 PM
  618. Make.Defaults         TEXT MPS      8K lvbspoImad    3/31/92  1:38 PM    3/31/92  1:16 PM
  619. MakeConvert           TEXT MPS      3K lvbspoImad     4/1/92  8:29 AM    3/18/92  4:24 PM
  620. Makefile              TEXT MPS      9K lvbspoImad    3/31/92  1:30 PM    3/31/92  1:16 PM
  621. Makeout               TEXT MPS      3K lvbspoImad     4/1/92  8:35 AM     4/1/92  8:31 AM
  622. mypreproc             Fldr Fldr    12K lvbspoImad    3/31/92  1:18 PM    3/31/92  1:18 PM
  623. params                Fldr Fldr     9K lvbspoImad    3/31/92  1:18 PM    3/31/92  1:18 PM
  624. preprocessor          Fldr Fldr  1998K lvbspoImad    3/31/92  1:19 PM    3/31/92  1:18 PM
  625. README                TEXT MPS      5K lvbspoImad    3/31/92  1:16 PM    3/31/92  1:16 PM
  626. 'README(MAC mods)'    TEXT MPS      8K lvbspoImad    3/19/92  7:40 AM    3/18/92  2:21 PM
  627. runtime               Fldr Fldr   632K lvbspoImad    3/31/92  1:20 PM    3/31/92  1:19 PM
  628. tests                 Fldr Fldr   764K lvbspoImad    3/31/92  1:21 PM    3/31/92  1:20 PM
  629. Unix2MacMakeTools     fdrp MACS     2K lvbspoImad     4/1/92  8:32 AM     4/1/92  8:26 AM
  630. UnixMakefile          TEXT MPS      9K lvbspoImad    3/31/92  1:30 PM    3/31/92  1:16 PM
  631. util                  Fldr Fldr   177K lvbspoImad    3/31/92  1:21 PM    3/31/92  1:21 PM
  632. Directory Unix2MacMakeTools
  633. ### Directory - Unable to set current directory.
  634. # Directory not found (OS error -120)
  635. Directory driver
  636. Directory
  637. 'DirectDrive(2):C-Development:ELROS:driver:'
  638.  
  639. Notice that "Unix2MacMakeTools" is of type fdrp and creator MACS. I created it
  640. by making an alias and placing it in the ELROS folder. Also notice that the
  641. folder "driver" is of type Fldr and creator Fldr. When I try to change the
  642. default folder to Unix2MacMakeTools, the command fails. However, it succeeds
  643. when I change it to driver.
  644.  
  645. Am I missing something or is this a bug?
  646.  
  647. Dan Nessett
  648.  
  649.  
  650. +++++++++++++++++++++++++++
  651.  
  652. From: ksand@apple.com (Kent Sandvik)
  653. Date: 10 Apr 92 01:30:32 GMT
  654. Organization: MacDTS Mongols
  655.  
  656. In article <121548@lll-winken.LLNL.GOV>, nessett@llnl.gov (Danny M. Nessett)
  657. writes:
  658. > I am having trouble using a folder alias from within the MPW shell. In
  659. > particular, if I use the finder to make an alias of a folder, place that
  660. > alias in another folder and then try to reference the alias as a child
  661. > folder, MPW doesn't cooperate. For example, consider the following
  662. > MPW commands and their output :
  663.  
  664. Most, if not all, MPW tools *don't* support aliases. I placed a request
  665. for change about this to tools engineering some time ago.
  666.  
  667. Cheers,
  668. Kent Sandvik
  669. Dynamic Language Missionary
  670.  
  671. +++++++++++++++++++++++++++
  672.  
  673. From: dn5@apix.psu.edu (D. Jay Newman)
  674. Date: 10 Apr 92 20:58:47 GMT
  675. Organization: Penn State
  676.  
  677. In article <22808@goofy.Apple.COM>, ksand@apple.com (Kent Sandvik) writes:
  678.  
  679. > Most, if not all, MPW tools *don't* support aliases. I placed a request
  680. > for change about this to tools engineering some time ago.
  681.  
  682. I *really* wish they did (at least the C++ compiler).  I am working on a
  683. project with 6 shared files, and using aliases would be *much* easier than
  684. either keeping two copies of source code (which occasionally change) or
  685. shuttling them back and forth.
  686.  
  687. I've tried to keep the shared files in a common directory, but never got
  688. that to work real well.
  689.  
  690. Actually, I've never been too impressed with Apple's following of their
  691. own rules.  MPW was *not* 32-bit clean long after Apple said that everything
  692. should be 32-bit clean.  Now Apple has been preaching about aliases for
  693. quite some time, and still MPW doesn't know about them.  Typical.
  694.  
  695. ()()()()()()()()()()()()() CBEL--Teaching & Learning Technologies ()()()
  696. D. Jay Newman     !            Save the whales
  697. dn5@psuvm.psu.edu !        (Collect the whole set)
  698. dn5@apix.psu.edu  !
  699.  
  700. +++++++++++++++++++++++++++
  701.  
  702. From: quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  703. Organization: The University of Western Australia
  704. Date: Mon, 13 Apr 1992 04:01:23 GMT
  705.  
  706. In article <pj#vHmu0n6@atlantis.psu.edu>, dn5@apix.psu.edu (D. Jay Newman) writes:
  707. > In article <22808@goofy.Apple.COM>, ksand@apple.com (Kent Sandvik) writes:
  708. >  
  709. > > Most, if not all, MPW tools *don't* support aliases. I placed a request
  710. > > for change about this to tools engineering some time ago.
  711. > I *really* wish they did (at least the C++ compiler).  I am working on a
  712. > project with 6 shared files, and using aliases would be *much* easier than
  713. > either keeping two copies of source code (which occasionally change) or
  714. > shuttling them back and forth.
  715. > I've tried to keep the shared files in a common directory, but never got
  716. > that to work real well.
  717.  
  718. If I was a member of MPW engineering I would tell you to use Projector.
  719. Projector was specifically designed to support projects where two people are
  720. modifying shared source code.  If you're going to put up with MPW's extreme
  721. lack of speed, the least you could do is actually use some of its neater
  722. features.
  723.  
  724. Quinn "The Eskimo!"   <quinn@cs.uwa.edu.au>  "Real Coke, Diet .sig"
  725. Department of Computer Science, The University of Western Australia
  726.   -- Projector's #1 biggest fan!
  727.  
  728.  
  729. ---------------------------
  730.  
  731. From: thomas@garnet.berkeley.edu (Mark)
  732. Subject: Animating floating point numbers?
  733. Date: 1 Apr 92 23:14:37 GMT
  734. Organization: University of California, Berkeley
  735.  
  736. Hi,
  737.  
  738. I'm doing some animation that includes floating point numbers.  The routine
  739. I'm using (my own) to convert from double to ascii is very slow.  On my IIx
  740. it takes about 7 ticks.  I clocked it against ThinkC's sprintf routine,
  741. which came out at about 8 ticks.  You can see the problem - 5 doubles = 35
  742. ticks = .5 seconds = lousy animation!
  743.  
  744. Does anyone have any ideas on how to write a ragingly fast double -> ascii
  745. routine?
  746.  
  747. Any help would be most appreciated,
  748.  
  749. Mark Thomas
  750.  
  751. +++++++++++++++++++++++++++
  752.  
  753. From: dougm@bradbury.cns.caltech.edu (Doug McNought)
  754. Organization: California Institute of Technology
  755. Date: Thu, 2 Apr 1992 02:35:45 GMT
  756.  
  757. In article <rdg4tINNg0h@agate.berkeley.edu> thomas@garnet.berkeley.edu (Mark) writes:
  758. >I'm doing some animation that includes floating point numbers.  The routine
  759. >I'm using (my own) to convert from double to ascii is very slow.  On my IIx
  760. >it takes about 7 ticks.  I clocked it against ThinkC's sprintf routine,
  761. >which came out at about 8 ticks.  You can see the problem - 5 doubles = 35
  762. >ticks = .5 seconds = lousy animation!
  763. >
  764. >Does anyone have any ideas on how to write a ragingly fast double -> ascii
  765. >routine?
  766.  
  767. Er--have you timed the Toolbox Num2Str or the SANE conversion routines? I have
  768. absolutely no idea whether they would be faster, but it's certainly possible.
  769. Remember, sprintf() has to deal with all the format string baggage, and your
  770. own routine may or may not be optimal. Try the built-in; Apple has been known
  771. to use good algorithms on occasion... :)
  772. regards,
  773. doug
  774. - -- 
  775. <><><><><><><><><><><><><><><>Go Orioles<><><><><><><><><><><><><><><><>
  776. <> Doug McNaught                          dougm@descartes.caltech.edu <>
  777. <>  Help!!! I'm addicted to *Spaceward Ho!* Is there a support group? <>
  778. <><><><><><><><><><><><><><><>Go Orioles<><><><><><><><><><><><><><><><>
  779.  
  780. +++++++++++++++++++++++++++
  781.  
  782. From: dpkemp@afterlife.ncsc.mil (David P. Kemp)
  783. Date: 13 Apr 92 00:28:26 GMT
  784. Organization: The Great Beyond
  785.  
  786. In article <1992Apr2.023545.25559@cco.caltech.edu> dougm@bradbury.cns.caltech.edu (Doug McNought) writes:
  787. >In article <rdg4tINNg0h@agate.berkeley.edu> thomas@garnet.berkeley.edu (Mark) writes:
  788. >>I'm doing some animation that includes floating point numbers.  The routine
  789. >>I'm using (my own) to convert from double to ascii is very slow.  On my IIx
  790. >>it takes about 7 ticks.  I clocked it against ThinkC's sprintf routine,
  791. >>which came out at about 8 ticks.  You can see the problem - 5 doubles = 35
  792. >>ticks = .5 seconds = lousy animation!
  793. >Er--have you timed the Toolbox Num2Str or the SANE conversion routines? I have
  794. >absolutely no idea whether they would be faster, but it's certainly possible.
  795. >... Apple has been known to use good algorithms on occasion... :)
  796.  
  797. A good algorithm in this case would be to avoid binary <-> ascii conversion
  798. entirely.  Any time you do formatted writes and reads, you're gonna be
  799. slow. The only reason to use ascii is if a human is going to look at the
  800. data, or if you are going to move it to a machine with a different
  801. architecture.  If both your data generating program and your animation
  802. program are running on the same machine, just use unformatted I/O. It'll
  803. be MUCH faster.
  804.  
  805.  
  806. - -- 
  807.    Dave Kemp   dpkemp@afterlife.ncsc.mil              "Pave the Bay!"
  808.    #include <std/disclaimer>
  809.  
  810. ---------------------------
  811.  
  812. From: kevind@pogo.wv.tek.com (Kevin Draz)
  813. Subject: Discipline, Mbg 6.2.2, Quadra
  814. Date: 2 Apr 92 02:21:02 GMT
  815. Organization: Tektronix Inc., Beaverton, Or.
  816.  
  817.  
  818. Does anyone have any information on running Discipline on a Quadra [900]
  819. with MacsBug 6.2.2?
  820.  
  821. I use 7.0.1 with tuner 1.1, both at home on my IICX where everything works
  822. fine, and here at work on the Quadra, where it's flaming death. [Bus Error]
  823. before it even gets fully initialized.
  824.  
  825. I've tried disabling caches, going back to 24 bit addressing, no VM, no
  826. inits, etc. and it's all the same.  Kaboom!  In 24 bit at least it tries to
  827. load the prefs file before dying.
  828.  
  829. I tried Disc. 2.0b1 from ETO#5, and also the released 1.something.
  830. 1.something, as an INIT, doesn't bomb, but instead says "Unknown error due
  831. to your debugger" or some such noise at bootup, and fails to load.
  832.  
  833. I usually like to bang my head until I figure things out myself, but I'm
  834. getting desparate, so I'll share my frustration with the net.
  835.  
  836. All help greatly appreciated.
  837.  
  838. KevinD
  839.  
  840.  
  841. - -- 
  842. - ----
  843. kevind@pogo.wv.tek.com  | For most software publishers, quality is job 1.01.
  844. Tektronix Color Printers|                            -- MacWeek Magazine
  845.  
  846. +++++++++++++++++++++++++++
  847.  
  848. From: ksand@apple.com (Kent Sandvik)
  849. Date: 10 Apr 92 23:05:48 GMT
  850. Organization: MacDTS Mongols
  851.  
  852. In article <12547@pogo.wv.tek.com>, kevind@pogo.wv.tek.com (Kevin Draz) writes:
  853. > Does anyone have any information on running Discipline on a Quadra [900]
  854. > with MacsBug 6.2.2?
  855. > I use 7.0.1 with tuner 1.1, both at home on my IICX where everything works
  856. > fine, and here at work on the Quadra, where it's flaming death. [Bus Error]
  857. > before it even gets fully initialized.
  858. > I've tried disabling caches, going back to 24 bit addressing, no VM, no
  859. > inits, etc. and it's all the same.  Kaboom!  In 24 bit at least it tries to
  860. > load the prefs file before dying.
  861.  
  862.  
  863. Welcome to the wonderful world of new CPU releases and old tools which
  864. break. Try Discipline 2.0.2 from ETO#7.
  865.  
  866. Cheers,
  867. Kent Sandvik/DTS
  868.  
  869. ---------------------------
  870.  
  871. From: kcheng@ecs.umass.edu
  872. Subject: THINK C PROGRAM QUESTION
  873. Date: 2 Apr 92 13:37:26 GMT
  874.  
  875. Need help with THINK C PROGRAM on mac
  876.  
  877.  
  878. I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
  879. said "bad F-line instruction"   What does this mean?
  880.  
  881. Thank you for your help.
  882.  
  883.  
  884. Hong Cheng
  885.  
  886. +++++++++++++++++++++++++++
  887.  
  888. From: asunta@convex.csc.FI (Miika Asunta)
  889. Date: 4 Apr 92 17:02:49 GMT
  890. Organization: Finnish Academic and Research Network Project - FUNET
  891.  
  892. In <17361.29db0e17@ecs.umass.edu> kcheng@ecs.umass.edu writes:
  893.  
  894. >Need help with THINK C PROGRAM on mac
  895.  
  896.  
  897. >I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
  898. >said "bad F-line instruction"   What does this mean?
  899.  
  900.  
  901. that means you have a... Bug!
  902.  
  903. Learn to use source level debugger to find out where the bug is, 
  904. then study the code carefully, and after heureka,
  905. eliminate the bug. Easy.
  906.  
  907. Miika
  908. - --
  909. &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  910. &  Miika Asunta        &  asunta@convex.csc.fi  &  Double Bass Player   &
  911. & tel. +358-0-494 093  &             &  Macintosh Programmer &
  912. &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  913.  
  914. +++++++++++++++++++++++++++
  915.  
  916. From: ksand@apple.com (Kent Sandvik)
  917. Date: 10 Apr 92 01:35:15 GMT
  918. Organization: MacDTS Mongols
  919.  
  920. In article <1992Apr4.170249.15465@nic.funet.fi>, asunta@convex.csc.FI (Miika
  921. Asunta) writes:
  922. > In <17361.29db0e17@ecs.umass.edu> kcheng@ecs.umass.edu writes:
  923. > >Need help with THINK C PROGRAM on mac
  924. > >I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
  925. > >said "bad F-line instruction"   What does this mean?
  926. > that means you have a... Bug!
  927. > Learn to use source level debugger to find out where the bug is, 
  928. > then study the code carefully, and after heureka,
  929. > eliminate the bug. Easy.
  930.  
  931. Jos sinulla on (sorry, back from Finnish to English mode), if you got
  932. a Quadra, then depending on the debugger patches in Think C 5.0 it's a 
  933. problem related to the sudden use of the F-line vector for Omega-SANE
  934. use (for trig functions missing in the built-in FPU). It's fixed with
  935. later patches for Think C, and SADE, and SourceBug, and ...
  936.  
  937. If this is not a Quadra, then you got problems!
  938.  
  939. Cheers,
  940. Kent Sandvik
  941. Dynamic Language Politician 
  942.  
  943. +++++++++++++++++++++++++++
  944.  
  945. From: cpastore@unity.ncsu.edu (Chris Pastore)
  946. Organization: North Carolina State University Computing Center
  947. Date: Fri, 10 Apr 1992 17:08:11 GMT
  948.  
  949. >> In <17361.29db0e17@ecs.umass.edu> kcheng@ecs.umass.edu writes:
  950.  
  951. >>>I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
  952. >>>said "bad F-line instruction"   What does this mean?
  953.  
  954. >> that means you have a... Bug!
  955.  
  956. Also, Think C has conflicts with lots of INITs.  It might be something
  957. that simple.  Get rid of them all and try again.
  958.  
  959.  
  960. - -- 
  961. Christopher M. Pastore         |Life would be so pleasant
  962. NC State University         |If we all could be
  963. Textile Materials Science   |Helpless, homeless creatures
  964. cpastore@nelson.tx.ncsu.edu |Marching to the sea.
  965.  
  966. ---------------------------
  967.  
  968. From: jacbop@z.eecs.umich.edu (Thomas Wilberding)
  969. Subject: Simple Sound Program
  970. Date: 3 Apr 92 21:25:45 GMT
  971. Organization: University of Michigan EECS Dept., Ann Arbor
  972.  
  973. I'm trying to write a simple program that will just play a 'snd ' res.
  974. I compiled the following program with THINK 5.0 and put a sound ID=128 into
  975. the application.
  976.  
  977. What I'd hoped would happen is, that teh sound would play and the app would
  978. quit. However I get error code -205 (badChannel, Channel is corrupt or
  979. unusable).
  980.  
  981. I also tried to use PlaySnd() after using GetResource(). This didn't
  982. work either.
  983.  
  984. _________________________________________________________________________
  985. #include <Types.h>
  986. #include <Sound.h>
  987.  
  988. int PlayFromFile(int);
  989.  
  990. void main()
  991. {
  992.     PlayFromFile(128);
  993. }
  994.  
  995. int PlayFromFile(int myResNum)
  996. {
  997.     SndChannelPtr    mySndChan;
  998.     
  999.     mySndChan = NULL;
  1000.     SndNewChannel(mySndChan,sampledSynth,initMono,NULL);
  1001.     
  1002.     SndStartFilePlay(mySndChan,0,myResNum,16*1024,NULL,NULL,NULL,1);
  1003.     
  1004.     if (mySndChan != NULL) {
  1005.         SndDisposeChannel(mySndChan,0);
  1006.     }
  1007. }
  1008. _________________________________________________________________________
  1009.  
  1010. If you haven't guessed, I have no clue how to program the Mac and really
  1011. have no "World View". I'm just taking Chap 22 of Vol VI very literally
  1012. and hoping things will work without knowing the big picture.
  1013.  
  1014. Perhaps a kind soul could point me towards some sample code for sound
  1015. input. Eventually, I want to write my own XCMD's to record/play AIFF
  1016. files for use in Supercard 1.6. The Hypercard audio palette won't work
  1017. with a standalone Supercard stack.
  1018.  
  1019. Thanks in advance,
  1020. Tom
  1021.  
  1022.  
  1023. - -- 
  1024. Tom Wilberding
  1025. jacbop@eecs.umich.edu
  1026. jacbop@engin.umich.edu
  1027.  
  1028. +++++++++++++++++++++++++++
  1029.  
  1030. From: REEKES@applelink.apple.com (Jim Reekes)
  1031. Date: 10 Apr 92 20:01:59 GMT
  1032. Organization: Apple Computer, Inc.
  1033.  
  1034. In article <1992Apr3.212545.18525@zip.eecs.umich.edu>, jacbop@z.eecs.umich.edu (Thomas Wilberding) writes:
  1035. > I'm trying to write a simple program that will just play a 'snd ' res.
  1036. > I compiled the following program with THINK 5.0 and put a sound ID=128 into
  1037. > the application.
  1038. > What I'd hoped would happen is, that teh sound would play and the app would
  1039. > quit. However I get error code -205 (badChannel, Channel is corrupt or
  1040. > unusable).
  1041. > I also tried to use PlaySnd() after using GetResource(). This didn't
  1042. > work either.
  1043. > _________________________________________________________________________
  1044. > #include <Types.h>
  1045. > #include <Sound.h>
  1046. > int PlayFromFile(int);
  1047. > void main()
  1048. > {
  1049. >     PlayFromFile(128);
  1050. > }
  1051. > int PlayFromFile(int myResNum)
  1052. > {
  1053. >     SndChannelPtr    mySndChan;
  1054. >     
  1055. >     mySndChan = NULL;
  1056. >     SndNewChannel(mySndChan,sampledSynth,initMono,NULL);
  1057. >     
  1058. >     SndStartFilePlay(mySndChan,0,myResNum,16*1024,NULL,NULL,NULL,1);
  1059. >     
  1060. >     if (mySndChan != NULL) {
  1061. >         SndDisposeChannel(mySndChan,0);
  1062. >     }
  1063. > }
  1064. > _________________________________________________________________________
  1065. > If you haven't guessed, I have no clue how to program the Mac and really
  1066. > have no "World View". I'm just taking Chap 22 of Vol VI very literally
  1067. > and hoping things will work without knowing the big picture.
  1068. > Perhaps a kind soul could point me towards some sample code for sound
  1069. > input. Eventually, I want to write my own XCMD's to record/play AIFF
  1070. > files for use in Supercard 1.6. The Hypercard audio palette won't work
  1071. > with a standalone Supercard stack.
  1072. >  
  1073. > Thanks in advance,
  1074. > Tom
  1075. > -- 
  1076. > Tom Wilberding
  1077. > jacbop@eecs.umich.edu
  1078. > jacbop@engin.umich.edu
  1079.  
  1080.  
  1081. 1. Don't use type int for the toolbox.  You're passing int as the refNum.
  1082.    This could be bad.  Use short as defined in Inside Mac.
  1083.  
  1084. 2. SndNewChannel returns an error, as does SndStartFilePlay.  NEVER ignore
  1085.    errors.  For example, don't call the second trap if the first one failed.
  1086.  
  1087. 3. SndNewChannel is defined to take a VAR parameter of type SndChannelPtr.
  1088.    You've passed SndChannelPtr, and it's supposed to be a pointer to a
  1089.    SndChannelPtr.  If you recompile you're MacHeaders and turn on prototype
  1090.    checking for toolbox routines.  By default, it's off.  This SUCKS!  You
  1091.    should always have this turned on.  Open the file "Mac #includes.c".
  1092.    Change the definition of SIMPLIFY_PROTOTYPES to be true.  Then precompile
  1093.    the file and save it as MacHeaders.  Then if you attempt to build your
  1094.    program it will complain that you've incorrectly called SndNewChannel.
  1095.  
  1096. 4. If you call SndStartFilePlay with a channel, you can play it asynchronously.
  1097.    If you call SndDisposeChannel immediately afterwards, with quietNow set
  1098.    to false then it's just like calling SndStartFilePlay "synchronously."
  1099.    You should and a call to SndChannelStatus to your event loop and dispose
  1100.    of the channel when the busy flag is false.
  1101.  
  1102. 5. You have to use a value of 20000 or greater for the size of the buffers
  1103.    passed to SndStartFilePlay.
  1104.  
  1105. 6. Use the constants true and false, instead of 1 and 0.
  1106.  
  1107.  
  1108. Ok, now I'm starting to become annoying.
  1109.  
  1110.  
  1111. - -----------------------------------------------------------------------
  1112. Jim Reekes, E.O.             |     Macintosh Toolbox Engineering
  1113.                              |          Sound Manager Expert
  1114. Apple Computer, Inc.         | "All opinions expressed are mine, and do
  1115. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  1116. Cupertino, CA 95014          |       employer, Apple Computer Inc."
  1117.  
  1118. ---------------------------
  1119.  
  1120. From: caruso@gbi01.enet.dec.com (Angelo Caruso)
  1121. Subject: UPMG II
  1122. Date: 3 Apr 92 07:42:27 GMT
  1123. Organization: Digital Equipment Corporation
  1124.  
  1125. I have heard about a Usenet Macintosh Programming Guide 2nd volume.
  1126. Is it true ? Where is it available ? 
  1127.  
  1128. Thanks.
  1129.  
  1130. +++++++++++++++++++++++++++
  1131.  
  1132. From: mxmora@unix.SRI.COM (Matt Mora)
  1133. Date: 10 Apr 92 16:48:13 GMT
  1134. Organization: SRI International, Menlo Park, California
  1135.  
  1136. In article <1992Apr3.064129.17144@vbohub.vbo.dec.com> caruso@gbi01.enet.dec.com (Angelo Caruso) writes:
  1137.  
  1138. >I have heard about a Usenet Macintosh Programming Guide 2nd volume.
  1139. >Is it true ? Where is it available ? 
  1140.  
  1141. No. Not for a while.
  1142.  
  1143.  
  1144.  
  1145. Matt
  1146.  
  1147.  
  1148. - -- 
  1149. ___________________________________________________________
  1150. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  1151. SRI International           |  my unix  mxmora@unix.sri.com
  1152. ___________________________________________________________
  1153.  
  1154. ---------------------------
  1155.  
  1156. From: essam@gagme.chi.il.us (Essam Khairullah)
  1157. Subject: Centering window from an INIT; how?
  1158. Organization: Gagme Public Access UNIX, Chicago, Illinois.
  1159. Date: Tue, 7 Apr 1992 09:54:51 GMT
  1160.  
  1161. I've written an INIT that pops up a window sometime after startup.  Basically
  1162. I'd like to know how to be able to center its window in the main screen.
  1163.  
  1164. Normally this should be easy, but you don't have access to QuickDraw's globals
  1165. from an INIT, or do you?  Note that I don't want to use System 7's auto
  1166. centering; I would like it to work on older system versions as well.
  1167.  
  1168. Any help would be greatly appreciated!
  1169.  
  1170. - -- 
  1171.                     Essam Badi' Abu Khalil Khairullah
  1172.               essam@gagme.chi.il.us
  1173.                  I don't got no fancy signature!
  1174. I'm a .signature virus. You can't resist copying me into your .signature!
  1175.  
  1176. +++++++++++++++++++++++++++
  1177.  
  1178. From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
  1179. Date: Fri, 10 Apr 1992 23:32:41 -0500
  1180.  
  1181.  EK> From: essam@gagme.chi.il.us (Essam Khairullah)
  1182.  EK> Newsgroups: comp.sys.mac.programmer
  1183.  EK> Organization: Gagme Public Access UNIX, Chicago, Illinois.
  1184.  EK> 
  1185.  EK> I've written an INIT that pops up a window sometime after startup. 
  1186.  EK> Basically, I'd like to know how to be able to center its window in
  1187.  EK> the main screen.
  1188.  EK> 
  1189.  EK> Normally this should be easy, but you don't have access to QuickDraw's
  1190.  EK> globals from an INIT, or do you?
  1191.  
  1192. Choose one of these three calls: GetWMgrPort, GetGrayRgn, or OpenPort.
  1193.  
  1194. ---------------------------
  1195.  
  1196. End of C.S.M.P. Digest
  1197. **********************
  1198.